UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9PBFJ1weBbEZjvKJ5DHGcjdYoy2SiCysTPolO61vEKw=' 
WHERE 
  key_id = '2f0906e9d9c626f40704d5959ae3584d1f15aac15219e89ebcb86c420c5754fb' 
  AND (
    token = '9PBFJ1weBbEZjvKJ5DHGcjdYoy2SiCysTPolO61vEKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044