UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LWGnNClx7/EO7rLjEutDqyCimBZJwYBNJ8+A7EdiRlc=' 
WHERE 
  key_id = '0cfec5e2f895061eb1938841aa3027c63729ef2e4d660d16977d6691cc25f179' 
  AND (
    token = 'LWGnNClx7/EO7rLjEutDqyCimBZJwYBNJ8+A7EdiRlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028