UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HITEC2eXpnH5iElGZm1C0DLJGuVgjJz0Ip/Buy4D4WY=' 
WHERE 
  key_id = '6f1fc42333ae6bf7d6352853327118821aab671750110c64ee4526a08af6e52a' 
  AND (
    token = 'HITEC2eXpnH5iElGZm1C0DLJGuVgjJz0Ip/Buy4D4WY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039