UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rs9oamwZEM6nX++Wbej83nLar2E3NJ92Fn9uDAAVjkk=' 
WHERE 
  key_id = '31568fadc81462d96ae91ab1c1480d443637e27cb4d6dbdbff16fb7cda6d8e6b' 
  AND (
    token = 'Rs9oamwZEM6nX++Wbej83nLar2E3NJ92Fn9uDAAVjkk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045