UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WESQLlDECFbrqlKZNJw3J9836ncv2eFzBgPTWpiZwjs='
WHERE
key_id = '0263cead38cdccd25673a93d573ee5fefb187cc1e19c9f6d7360fa1e509eba80'
AND (
token = 'WESQLlDECFbrqlKZNJw3J9836ncv2eFzBgPTWpiZwjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)