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