UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVjLfgxSm8rbg70lhBBUxhLw55lKIHCHvqeNWvGIzjg='
WHERE
key_id = 'e3310dda79b4129be7f45fa6d4d385ff5bbaefe026a15b2cd47d65ac99b208cd'
AND (
token = 'rVjLfgxSm8rbg70lhBBUxhLw55lKIHCHvqeNWvGIzjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)