UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mATz0EVXyIoChANPuomYvq0Rji92Ak45WOLZv9fOgFk=' 
WHERE 
  key_id = 'fd80f2d0c8a68f9b147db4ffc4948a10f582a409af46a163723e7e92f24a4b5f' 
  AND (
    token = 'mATz0EVXyIoChANPuomYvq0Rji92Ak45WOLZv9fOgFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023