UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Uz+7BEvSLhsBGPsg6ydj3KoykMd8xdG0B1ZUdL6d9n4=' 
WHERE 
  key_id = 'c8d18159867de30c267bdb0762608d2199ffc38da7f962ba5197730bcd149ae2' 
  AND (
    token = 'Uz+7BEvSLhsBGPsg6ydj3KoykMd8xdG0B1ZUdL6d9n4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042