UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wp4EpoyBR3/sm/qHAixjLnWXE41++Vy7Nez+mDMGXlM=' 
WHERE 
  key_id = '9b7f2dd29ffce406453832e550334723b87754e2423bac46575f23005e7ba6a9' 
  AND (
    token = 'wp4EpoyBR3/sm/qHAixjLnWXE41++Vy7Nez+mDMGXlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028