UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8gL2X6wSC8wsFUOuGP90cKnirURV+UK6jjCt9HxOxjQ=' 
WHERE 
  key_id = '999fd466397006271270d4af1fb0ee80d3edd6617dc7a6a710114fc5b15ad8a4' 
  AND (
    token = '8gL2X6wSC8wsFUOuGP90cKnirURV+UK6jjCt9HxOxjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033