UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xni4EkBGIU4xyWWlVGSCdbsa+CotQ8JxKD15BsSA9AA='
WHERE
key_id = '30faf268e56e3df6de8b099d265afd447ae5e59032b7c9d0fa8069dc9275b6eb'
AND (
token = 'xni4EkBGIU4xyWWlVGSCdbsa+CotQ8JxKD15BsSA9AA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)