UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VNC8TrynDjmTTfdZosMfiTGE2oOQmXInvSbSj89r8dE=' 
WHERE 
  key_id = '436c4b2f8da14019ef9e05a55f14fd6778648fb32dd5024f68133ae4dc88e63b' 
  AND (
    token = 'VNC8TrynDjmTTfdZosMfiTGE2oOQmXInvSbSj89r8dE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024