UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mQXbjdC9Rq66Xrdi5W7ZvryTKXOpCDXmw0ircse/+sQ='
WHERE
key_id = '4627a4726cb94a84e0aa8e12e9a53ea983bd57f0556da4bfe493061311048349'
AND (
token = 'mQXbjdC9Rq66Xrdi5W7ZvryTKXOpCDXmw0ircse/+sQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)