UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jM1FY07kO3GnpSWmuVSL9Ntv7hAsJeR46GuY6lQIdgc='
WHERE
key_id = '17e79a968a358d3135e83214611c7c0c0700067a46749c0d4340f8ea9be9a44d'
AND (
token = 'jM1FY07kO3GnpSWmuVSL9Ntv7hAsJeR46GuY6lQIdgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)