UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ldXJs4EpgnaRNKGN+MFz12Q6/kZoNSMXYkUDTlBZ3zQ=' 
WHERE 
  key_id = 'fc05e9c62e79eeedea737bb5c196e53db420f5ecaf098a8f8139f9f5317fc1d7' 
  AND (
    token = 'ldXJs4EpgnaRNKGN+MFz12Q6/kZoNSMXYkUDTlBZ3zQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016