UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mG6hcIvi2BqyEFSvZP0SJfiwXs1bU4BR8x8CYLU4kJk=' 
WHERE 
  key_id = '52d802683bcc994551747c74118c14b22835d3f833605c4f30f03b50fbb69e06' 
  AND (
    token = 'mG6hcIvi2BqyEFSvZP0SJfiwXs1bU4BR8x8CYLU4kJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025