UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gJ73QeifEqlky1FNxb/r7Z61Ij0rU2G9ETeD7AM5RG0='
WHERE
key_id = '1c74f4a1cbc77471f70bbd1aac6e40a23ae1adee8a1c52636a05fc8d11292deb'
AND (
token = 'gJ73QeifEqlky1FNxb/r7Z61Ij0rU2G9ETeD7AM5RG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)