UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YtXsJ/JLc/sGqaLKja30pilepFUYWid6LrFuNrI1gjo='
WHERE
key_id = '53f09156be0b2fa29ff46995bddec343f76d080026d88cf896725d49da1eb9e2'
AND (
token = 'YtXsJ/JLc/sGqaLKja30pilepFUYWid6LrFuNrI1gjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)