UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mmmlPpzxcQMTU4OsythkPtegyfGg31r3LHZhRJgcNEY=' 
WHERE 
  key_id = '44ac6e50071bb074f5c44b442fa90c2ea2b1290560acd99a6da42d83be7e07bc' 
  AND (
    token = 'mmmlPpzxcQMTU4OsythkPtegyfGg31r3LHZhRJgcNEY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025