UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uZJUdOO1x456zSxOqDRf6pFp1Z2M/Pm0Q7KJ/bfFV64='
WHERE
key_id = 'fc512b362e6f85a9172887f82fbc194d51443b259457baf93f2a19bc49657b59'
AND (
token = 'uZJUdOO1x456zSxOqDRf6pFp1Z2M/Pm0Q7KJ/bfFV64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)