UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fK+5ih2fj5zgw495pySVFtcJyx2r3N7b353pjfpMuM8='
WHERE
key_id = 'a7adff92f4dca34c9a197511cd15b4a5903edb929d7820923aaae4cf1180903d'
AND (
token = 'fK+5ih2fj5zgw495pySVFtcJyx2r3N7b353pjfpMuM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)