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

Query time 0.00016