UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rLYyuorA07Ghu6+LZ3WlVDOynNXzvBdN9iyvYsuCu74=' 
WHERE 
  key_id = '7bba4b43bddf2832a51a6e88e21347973f1778ed439cc75aff8bd59029cb5dda' 
  AND (
    token = 'rLYyuorA07Ghu6+LZ3WlVDOynNXzvBdN9iyvYsuCu74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022