UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CF717IF9yUVtpGCmNyiD3sIJejcKYDwzIr9IWKFYOiU='
WHERE
key_id = '92363de9824ed839591527fe5d9a0218b8da7cebea21f58d53e62bb65dcd3ae4'
AND (
token = 'CF717IF9yUVtpGCmNyiD3sIJejcKYDwzIr9IWKFYOiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)