UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3LOaPBbA7tLcNMBRG6cOgMlfn0UOxmTK+wcPF4rP62k='
WHERE
key_id = '6557ef1d294c162e0e1fe09db468aa810c67c3da3ba70873455f00c997e2799a'
AND (
token = '3LOaPBbA7tLcNMBRG6cOgMlfn0UOxmTK+wcPF4rP62k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)