UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MjJa0BLKZMZt/ezyjVFA4+cwoApSlUsCxYYd2iKKetA='
WHERE
key_id = 'da5506254e681bfefdb7cb951d52db5058e4c1a91e0b4076d7ce71d10dc6b90b'
AND (
token = 'MjJa0BLKZMZt/ezyjVFA4+cwoApSlUsCxYYd2iKKetA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)