UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+pVYGaIV4DOGSCxqhyTYGpe/+yd0Sexw82h1tT0njJs='
WHERE
key_id = 'f56d263cbfafd5c4eccc0dba7d9ffc9d23514fdbfc0525d6177ad29780bf71bd'
AND (
token = '+pVYGaIV4DOGSCxqhyTYGpe/+yd0Sexw82h1tT0njJs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)