UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MuDTKmSkd47RlHcq8NEJTveoJ/pIKi3ki05/e0MOCN8=' 
WHERE 
  key_id = '956dbfcf58657cd62e77d6da12b6ea60347666971dd3c007da6f1f6a4706d914' 
  AND (
    token = 'MuDTKmSkd47RlHcq8NEJTveoJ/pIKi3ki05/e0MOCN8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038