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

Query time 0.00053