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

Query time 0.00028