UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ASXmCb0izPSHqPkfRGyKlRWfYvszR4S/UoDT/VgDTFo='
WHERE
key_id = 'c78bdea3acd24ee174688663dd7f4118a2d2fbb6d681b670ce4a0b74c63e4475'
AND (
token = 'ASXmCb0izPSHqPkfRGyKlRWfYvszR4S/UoDT/VgDTFo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)