UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QxRsD3yzuYJGs+yE2uwHiCiQVZe7IFNJ24i7p/9dHoY=' 
WHERE 
  key_id = 'd24c53035ef7a5c233eb8a0172c1b73adcc3a949f13d53bb56f562139a4ee0b7' 
  AND (
    token = 'QxRsD3yzuYJGs+yE2uwHiCiQVZe7IFNJ24i7p/9dHoY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017