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

Query time 0.00058