UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zzIPyusv/yG+JtF1kfcYBFADXDeScWZkzviFTDXp64A=' 
WHERE 
  key_id = '584d9f950d5077fca03003099f82e172a4d1d2567dcff2eef574b3c9bed99144' 
  AND (
    token = 'zzIPyusv/yG+JtF1kfcYBFADXDeScWZkzviFTDXp64A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037